function go_shouye(){
    window.location.href = 'shouye.html'
}
var nowpage = 1
// jeDate({
//     dateCell:"#startTime",
//     format:"YYYY年MM月DD日 hh:mm:ss",
//     isinitVal:true,
//     isTime:true, //isClear:false,
//     minDate:"2014-09-19 00:00:00",
//     okfun:function(val){alert(val)}
// })
// jeDate({
//     dateCell:"#endTime",
//     format:"YYYY年MM月DD日 hh:mm:ss",
//     isinitVal:true,
//     isTime:true, //isClear:false,
//     minDate:"2014-09-19 00:00:00",
//     okfun:function(val){alert(val)}
// })

// laydate.render({
//     elem: '#timedate1'
// });
// laydate.render({
//     elem: '#timedate2'
// });
var form1 = {
        size: 10,
        page: 1,
        orderCode: "",
        startTime: "",
        endTime: "",
        lowPrice: null,
        highPrice: null,
        status: "",
        merchantNo:''
    }
var form2 = {
    total: 2000,
    pageSize: 10,
    showTotal: true,
    showTo: true,
    change: function ( i ) {
        createContent( i );
    }
}
var $content = $( ".content" );
function getTableData(form1){
    // form1.startTime = document.getElementById('startTime').value.replace('年','-').replace('月','-').replace('日','')
    // form1.endTime = document.getElementById('endTime').value.replace('年','-').replace('月','-').replace('日','')
    $.ajax({
    url:initObj.url + "/api/recharge/findRecharge",
    // data:JSON.stringify(form1),
    data:form1,
    datatype:'json',
    type:'get',
    // contentType: "application/json;charset=utf-8",
    beforeSend: function(request) {
       request.setRequestHeader("token", form.token);
    //    console.log(form.token)
    },
    success:function(res){
        console.log(res)
        document.getElementById('selectAll').innerHTML = ""
        for(var i=0;i<res.data.content.length;i++){
            // console.log(1)
            document.getElementById('selectAll').innerHTML += 
            "<li><span style='width:10vw;display:inline-block'>"+res.data.content[i].rechargeBankMain+
            "</span><span style='width:18vw;display:inline-block'>"+res.data.content[i].rechargeBankMainSon+
            "</span><span style='width:15vw;display:inline-block'>"+res.data.content[i].rechargeBankCard+
            "</span><span style='width:10vw;display:inline-block'>"+res.data.content[i].bankUsername+
            "</span><span style='width:10vw;display:inline-block'>"+res.data.content[i].amount+
            "</span><span class='static' style='font-weight:bold;width:5vw;display:inline-block'>"+res.data.content[i].state+
            "</span></li>"
            if(res.data.content[i].state == 'WAIT'){
                document.getElementsByClassName('static')[i].style.color = '#fe9368'
                document.getElementsByClassName('static')[i].innerHTML = "审核中"
            }else if(res.data.content[i].state == 'FAIL'){
                document.getElementsByClassName('static')[i].style.color = '#f91d1d'
                document.getElementsByClassName('static')[i].innerHTML = "审核未通过"
            }else{
                document.getElementsByClassName('static')[i].style.color = '#15b68f'
                document.getElementsByClassName('static')[i].innerHTML = "审核通过"
            }
        }
        if(form2.total !== res.data.totalElements){
            form2.total = res.data.totalElements
            Helper.ui.page("#page-3", form2);
            nowpage++
        }
    }
    })
}
getTableData(form1)
function createContent (i) {
    form1.page = i
    getTableData(form1)
}
function changeinfo(id,value){
    form1[id] = value
    // console.log(form1)
}
function search(){
    getTableData(form1)
}